//
//  GFont.mm
//  GEngine
//
//  Created by liu dingxi on 09-8-27.
//  Copyright 2009 tencent. All rights reserved.
//


#import <UIKit/UIKit.h>
#include "iphone.h"
#include "GFont.h"


bool GFont::Create(LPCTSTR szFont, LONG lHeight, LONG lWeight,
				   bool bItalic , bool bUnderline)
{
	if(m_pFont == NULL)
	{
		NSString* nsName = [[NSString alloc] initWithUTF8String:szFont];
		UIFont* pFont = [UIFont fontWithName:nsName size:lHeight];
		
		m_pFont = pFont;

		[nsName release];

		return (m_pFont != NULL) ? true : false;
	}
	return false;
}

bool GFont::Destroy()
{
	if(m_pFont)
	{
		UIFont* pFont = (UIFont*)m_pFont;
		[pFont release];
		m_pFont = NULL;
	}
	return false;
}
